define(['text!/home/home.html', 'css!/home/css/home.css'],function (html) {

	function loadData() {
			$.get('./common/data.json', function (data){
				console.log(data);
				data.data.act_info[0].act_rows.forEach(function (items) {
					// console.log(items.activity.img);
					$(`<img src='${ items.activity.img }'>`).appendTo('#banner');
				});

				
				data.data.act_info[1].act_rows.forEach(function (items) {
					// console.log(items);
					$(`<li>
						<figure>
							<a href="#"><img src="${ items.activity.img }" alt=""></a>
							<p>${ items.activity.name }</p>
						</figure>
					</li>`).appendTo('#nav_ul');
				});

				data.data.act_info[4].act_rows[1].act_rows.forEach(function (items) {
					// console.log(items);
					$(`
						<a href="#"><img src="${ items.cactivity_detail.img }" alt=""></a>
					`).appendTo('#hot');
				});

				data.data.act_info[4].act_rows[2].act_rows.forEach(function (items) {
					$(`
						<li><a href="#"><img src="${ items.cicons_detail.img}" alt=""></a><p>${ items.cicons_detail.name}</p></li>
					`).appendTo('#fruit_ul');
				});

				data.data.act_info[5].act_rows[0].category_detail.goods.forEach(function (items) {
					console.log(items.img);
					$(`
						<figure>
							<a href="#"><img src="${ items.img }" alt=""></a>
							<figcaption>
								<p>${ items.name }</p>
								<p>精选</p>
								<p>${ items.specifics }</p>
								<p>￥${ items.partner_price }<span>￥${ items.market_price }</span></p>
								<p>+</p>
							</figcaption>
						</figure>
					`).appendTo('#manyGoods');
				});



			})

	};

	function lunbo() {

	};
	return {

		init: function () {
			    $("#content").html(html);
                $('#header').load('./common/header.html');
                loadData();
		},

	}



})
